package com.linchong.concurrency.chapter6;

import lombok.extern.slf4j.Slf4j;

/**
 * @Author:linchong
 * @CreateTime:2020-01-04 09:53
 * @Description:强制关闭线程
 */
@Slf4j
public class ThreadCloseForce {


	public static void main(String[] args) {
		ThreadService service = new ThreadService();
		long start = System.currentTimeMillis();

		//load a resource
		service.excute(() -> {
			while (true) {

			}
		});
		service.shutdown(10000);
		long end = System.currentTimeMillis();
		System.out.println(end - start);
	}

}
